package com.xuerhua.yxt.controller.sys.student;

import java.util.List;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.xuerhua.yxt.common.RspResult;
import com.xuerhua.yxt.common.enums.Status;
import com.xuerhua.yxt.controller.BaseController;
import com.xuerhua.yxt.model.FinalTermScoreReport;
import com.xuerhua.yxt.reqVo.BaseQueryVO;
import com.xuerhua.yxt.service.IFinalTermScoreReportService;

@RequestMapping("sys/student/termReport")
@Controller
public class SysStudentTermReportController extends BaseController {

	private Logger logger = LoggerFactory.getLogger(SysStudentTermReportController.class);
	
	@Autowired
	private IFinalTermScoreReportService finalTermScoreReportService;
	
	@RequestMapping(value = {"","/"})
	public String index() {
		return "sys/student/termReport";
	}
	
	@RequestMapping("json/queryClassTermReport")
	@ResponseBody Object queryClassTermReport(BaseQueryVO vo) {
		List<FinalTermScoreReport> list = finalTermScoreReportService.selectClassTermReport(vo);
		return list;
	}
	
	@RequestMapping("json/updateStudentTermReport")
	@ResponseBody Object updateStudentTermReport(FinalTermScoreReport record) {
		try {
			finalTermScoreReportService.updateByPrimaryKeySelective(record);
			return new RspResult(Status.SUCCESS);
		} catch (Exception e) {
			logger.error("--updateStudentTermReport error={}", e);
		}
		return new RspResult(Status.FAIL);
	}
	
}
